import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '小节id',
    align: "center",
    dataIndex: 'sectionId'
  },
  {
    title: '笔记内容',
    align: "center",
    dataIndex: 'content'
  },
  {
    title: '播放时间',
    align: "center",
    dataIndex: 'playbackTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '创建用户id',
    align: "center",
    dataIndex: 'userId'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '小节id',
    field: 'sectionId',
    component: 'Input',
  },
  {
    label: '笔记内容',
    field: 'content',
    component: 'InputTextArea',
  },
  {
    label: '播放时间',
    field: 'playbackTime',
    component: 'DatePicker',
  },
  {
    label: '创建用户id',
    field: 'userId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
